package com.zf.shuashua.manager;

import com.vise.xsnow.http.callback.ACallback;
import com.zf.shuashua.ShuaApplication;
import com.zf.shuashua.api.HttpData;
import com.zf.shuashua.bean.BaseData;

/**
 * 渠道数据上报接口
 */
public class ReportChannelManager {

    private static ReportChannelManager instance;

    private ReportChannelManager() {

    }

    public static ReportChannelManager getInstance() {
        if (null == instance) {
            synchronized (ReportChannelManager.class) {
                if (null == instance) {
                    instance = new ReportChannelManager();
                }
            }
        }
        return instance;
    }

    /**
     * 渠道数据上报接口，点击数、下载数、打开数、注册数等
     * @param channel_event  渠道事件 1-点击数 2-下载数 3-注册数
     */
    public synchronized void reportChannelData(int channel_event){
        HttpData.getInstance().reportChannelData(ShuaApplication.channel, channel_event, new ACallback<BaseData>() {
            @Override
            public void onSuccess(BaseData data) {

            }

            @Override
            public void onFail(int errCode, String errMsg) {
            }
        });
    }

}
